import Vue from 'vue'
import App from './App.vue'
import ajax from './tools/ajax.js'
import router from './tools/router'
import store from './tools/store' //引入状态管理 store


// 按需引入组件
import { Layout, Row, Col } from 'ant-design-vue'
import { Carousel } from 'ant-design-vue'
import { Collapse, Card, Skeleton } from 'ant-design-vue'
import { Avatar, Icon, List, Comment } from 'ant-design-vue'
import { Affix, Button, Alert, Spin,Checkbox } from 'ant-design-vue'
import { Drawer, Modal } from 'ant-design-vue'
import { Form, Input } from 'ant-design-vue'
import { BackTop,Anchor } from 'ant-design-vue'



// 全局注册Layout
Vue.component(Layout.name, Layout);
Vue.component(Layout.Header.name, Layout.Header);
Vue.component(Layout.Content.name, Layout.Content);
Vue.component(Layout.Footer.name, Layout.Footer);
// 走马灯
Vue.component(Carousel.name, Carousel);
// 卡片
Vue.component(Card.name, Card);
Vue.component(Card.Meta.name, Card.Meta);
Vue.component(Avatar.name, Avatar);
Vue.component(List.name, List);
Vue.component(List.Item.name, List.Item);
Vue.component(Comment.name, Comment);
Vue.component(Icon.name, Icon);
//折叠面板
Vue.component(Collapse.name, Collapse);
Vue.component(Collapse.Panel.name, Collapse.Panel);
// 骨架屏
Vue.component(Skeleton.name, Skeleton);
// 栅格
Vue.component(Row.name, Row);
Vue.component(Col.name, Col);
// 浮动导航
Vue.component(Affix.name, Affix);
Vue.component(Button.name, Button);
Vue.component(Button.Group.name, Button.Group);
Vue.component(Alert.name, Alert);
Vue.component(Spin.name, Spin);
Vue.component(Checkbox.name, Checkbox);
Vue.component(Checkbox.Group.name, Checkbox.Group);
// 抽屉弹框
Vue.component(Drawer.name, Drawer);
Vue.component(Modal.name, Modal);
// 表单
Vue.component(Form.name, Form);
Vue.component(Form.Item.name, Form.Item);
Vue.component(Input.name, Input);
Vue.component(BackTop.name, BackTop);
Vue.component(Anchor.name, Anchor);
Vue.component(Anchor.Link.name, Anchor.Link);

Vue.prototype.ajax = ajax;
Vue.config.productionTip = false
new Vue({
    router,
    store,//注册store(这可以把 store 的实例注入所有的子组件)
    render: h => h(App)
}).$mount('#app')